package com.ss.android.article.base.feature.model;

import android.util.Log;

/**
 * Created by hsji on 2018/8/12.
 */

public class Logger {
    private static final String TAG = Logger.class.getSimpleName();
    private static final int MAX_LENGTH = 2 * 1024;

    public static final void d(String tag, String content) {
//        if (TextUtils.isEmpty(content)) {
//            return;
//        }
//        if (TextUtils.isEmpty(tag)) {
//            tag = TAG;
//        }
        tag = "travis";
        int readLength = 0;
        int totalLength = content.length();
        while (readLength < totalLength) {
            int lastReadLength = readLength;
            int desire = readLength + MAX_LENGTH;
            if (desire < totalLength) {
                readLength = desire;
            } else {
                readLength = totalLength;
            }
            String sub = content.substring(lastReadLength, readLength);
            Log.d(tag, sub);
        }
    }

    public static void printStackTrace() {
        new Exception("stackTrace").printStackTrace();
    }
}
